package com.nanhai.buddhist.college.framework.common.util.number;

import cn.hutool.core.math.MathUtil;
import cn.hutool.core.util.StrUtil;
import com.nanhai.buddhist.college.framework.common.util.date.DateUtils;

import java.util.Random;

/**
 * 数字的工具类，补全 {@link cn.hutool.core.util.NumberUtil} 的功能
 *
 * @author 开发
 */
public class NumberUtils {

    public static Long parseLong(String str) {
        return StrUtil.isNotEmpty(str) ? Long.valueOf(str) : null;
    }

    public static String getCodeByServ(String letter){

        Random ra =new Random();
        String ranNum = String.valueOf(ra.nextInt(9999-1000+1)+1000);
        String str =  letter + DateUtils.getDataFormatMD() + ranNum;
        return str;
    }


    public static void main(String[] args) {
        System.out.print(getCodeByServ("yw"));
    }
}
